<?php 
## include required files
/*******************************/
require_once '../../includefiles.php';
require_once '../../model/users.php';
require_once '../../model/email.php';
include_once("../../model/state.php");
require_once "../../includes/classes/paging_htacess.php";
include_once("../../model/blogs.php");

## creating objects of required models
$userObj  = new Model_Users();
$tradeObj = new Model_TRADE();
$stateObj = new Model_State();
$blogsObj = new Model_Blogs();


## for pagination
$page = $_GET['id1'];
if(!isset($_GET['id1']))
$page = 1;
else
$page = $page;
$limit = 20;
$offset = ($page-1) * $limit;
$blogs = $blogsObj->getAllBlogs($limit,$offset);
$active ="blogs";
$total_pages = $blogsObj->countBlogs();
$show = 1;
$firstlink = '/blogs/';
$baselink = '/blogs/';

if($total_pages!=0)
	$pagenation = pagination($total_pages, $show, $showing, $firstlink, $baselink, "", "blogs");
$smarty -> assign("pagenation", $pagenation);
$smarty -> assign("page", $page);


$smarty->assign('active',$active);
$smarty->assign('blogs',$blogs);
$smarty->assign("seoArray",array('meta_title'=>'Blogs'));
$smarty->display(TEMPLATEDIR.'/modules/blogs/listblogs.tpl');

unset($smarty);
?>
